<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>

<!DOCTYPE HTML>
<html>
  <head> 
	<%@ include file="/platform/style.jsp"%>
	<link href='<%=path %>/plugins/font-awesome/css/font-awesome.min.css' rel='stylesheet' type='text/css'>
	
	<script>
	function query(){
		$w.execForm({pageNum:1})
	}
	function addhotProduct(){
		$w.openDialog({url:ctx+'/products/ProductPage@hotShow.page',title:"热销商品 ",w:800,h:450,maximized:true,afterClose:function(re){
			if(re)query();
		}});
	}
	
	function hotstatus(status){
		$w.doUrl(ctx+"/products/ProductPage@hotStatus.page?bean.setstatus="+status,$("#queryForm").serializeArray(),function(){
			query();
		})
	}
	function hotdel(){
		window.parent.$w.confirmMsg("确定移除？", function(r){
			if(r){
				$w.doUrl(ctx+"/products/ProductPage@hotDel.page",$("#queryForm").serializeArray(),function(){
					query();
				})
			}
		})
	}
	</script>
  </head>
  
  <body class="easyui-layout">
	<div data-options="region:'center'" class="bodybg">
		<!-- 查询区域 -->
		<form id="queryForm" action="/products/ProductPage@hotlist.page" method="post">
		<div class="easyui-panel ui-queryBar" border="false" data-options="doSize:false">
			<w:hidden bind="pageNum"/>
			<w:hidden bind="pageSize_"/>
			<table cellpadding="0" cellspacing="0" style="margin-top:5px">
				<tr>
					<td width="80" align="right">商品编号：</td><td><w:text bind="bean.code" style="width:90px;"/></td>
					<td width="80" align="right">商品名称：</td><td><w:text bind="bean.name" style="width:110px;"/></td>
					<td width="80" align="right">商品分类：</td><td><select id="classtree" name="bean.classid" class="easyui-combotree" style="width:180px;height:28px;" data-options="url:'<%=path %>/products/ProductClassPage@loadClassTree.page'"></select></td>
					<td width="80" align="right">状态：</td><td><select name="bean.status"><option value="">-全部-</option><w:option bind="bean.status" value="0">待上架</w:option><w:option bind="bean.status" value="1">已下架</w:option><w:option bind="bean.status" value="2">已上架</w:option></select></td>
					<td>
						&nbsp;<a href="javascript:;" class="easyui-linkbutton" iconCls="icon_search" onclick="query()">查询</a>
					</td>
				</tr>
			</table>
		</div>
		<div class="easyui-panel ui-toolBar" border="false" data-options="doSize:false">
			<a href="javascript:;" class="easyui-linkbutton" plain="true" onclick="addhotProduct()" style="width:50px;">添加</a>
			<a href="javascript:;" class="easyui-linkbutton" plain="true" onclick="hotstatus(2)" style="width:50px;">上架</a>
			<a href="javascript:;" class="easyui-linkbutton" plain="true" onclick="hotstatus(1)" style="width:50px;">下架</a>
			<a href="javascript:;" class="easyui-linkbutton" plain="true" onclick="hotdel()" style="width:50px;">删除</a>
		</div>
		<div class="ui_line" style="margin-top:10px"></div>
		<!-- 数据列表区域 -->
			<table class="ui-table" width="100%" cellpadding="1" cellspacing="1" data-options="showPage:true,
																										pageNum:<w:write bind="pageNum"/>,
																										pageSize:<w:write bind="pageSize_"/>,
																										total:<w:write bind="pagination.totalCount"/>,form:'queryForm'">
				<thead>
					<tr class="ui_th">
						<td width="35" align="center"><input type="checkbox" onclick="$selAllTbBoxs(this)"></td>
						<td width="40">ID</td>
						<td width="60">商品图片</td>
						<td width="100">商品编号</td>
						<td>商品名称</td>
						<td width="100">类目</td>
						<td width="100">顺序</td>
						<td width="100">状态</td>
						<td width="70" align="center">操作</td>
					</tr>
				</thead>
				<tbody>
				<w:iterate id="info" bind="resultList_">
					<tr class="ui_td">
						<td align="center"><input type="checkbox" name="primaryKey_" value="<w:write bind="#info.id"/>"></td>
						<td><w:write bind="#info.attrid"/></td>
						<td><w:notEqual bind="#info.photo" value=""><img src="${fileserver }<w:write bind="#info.photo"/>" style="width:40px;height:30px;"></w:notEqual></td>
						<td><w:write bind="#info.productcode"/></td>
						<td><w:write bind="#info.fullname"/></td>
						<td><w:write bind="#info.clsName"/></td>
						<td><w:write bind="#info.orderno"/></td>
						<td><w:write bind="#info.status" format="[待上架,已下架,已上架]"/></td>
						<td align="center">
							<a href="javascript:void(0);" class="ui_btn marginR8" onclick="addhotProduct()">编辑</a>
						</td>
					</tr>
				</w:iterate>
				</tbody>
			</table>
		</form>
		
	</div>
	
  </body>
</html>
